<?php

/**
* Fetch global header
* And check the status if it is valid
* where STATUS = _NOT_ACTIVE
*
*/
$CLFetchers->fetchLstDataHeader($Db,
                                $jobId,
                                $SourceDb->fetchValue("srcDbHdr"),
                                $nHeader,
                                $lstHeader);

$_POST["codeEnt"]     = $lstHeader["C_B_CODE"][0];
$_POST["nameEnt"]     = $lstHeader["C_B_NAME"][0];
$_POST["accNoEnt"]    = $lstHeader["ACC_NO"][0];
$_POST["typeEnt"]     = $lstHeader["TYPE"][0];
$_POST["currencyEnt"] = $lstHeader["CURRENCY"][0];
$_POST["glAccEnt"]    = $lstHeader["GL_ACC"][0];
$_POST["glSubAccEnt"] = $lstHeader["GL_SUB_ACC"][0];

/**
* Init the detail
*
*/
$CLFetchers->fetchLstDataDetail($Db,
                                $jobId,
                                $SourceDb->fetchValue("srcDbDtl"),
                                $nDetail,
                                $lstDetail);

for($iRow = 0; $iRow < $nDetail; $iRow++){

  $_POST["userEnt"][$iRow] = $lstDetail["USERID"][$iRow];
}

echo  //Global misc function of js
      "<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"../javascript/misc.js\"></SCRIPT> \n".
      "<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"../javascript/GMisc.js\"></SCRIPT> \n".

      //This modul misc.js collections of function
      "<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"javascript/misc.js\"></SCRIPT> \n".

      //The ajax connections
      "<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"javascript/ajax.js\"></SCRIPT> \n".

      "<link rel=\"stylesheet\" type=\"text/css\" href=\"../myMenu.css\"/>\n".

      /**
      * Since this is to prevent default 'enter'
      *
      */
      "<body >\n".
      "<form  name='initMe' action=entry.php method=post>\n".

      /**
      * Global header
      *
      */
      "<table border='1' class='dedeq' >\n".
      "<tr>\n".

      "<th> Code   </th><td> ".$_POST["codeEnt"]." </td>\n".

      "<th> Name   </th><td ".$GHtml->rowColSpan( 1, 3)."> ".$_POST["nameEnt"]." </td>\n".

      "<th> Acc.No </th><td> ".$_POST["accNoEnt"]." </td>\n".

      "</tr>\n".
      "<tr>\n".

      "<th> Type      </th><td> ".$_POST["typeEnt"]." </td>\n".

      "<th> Currency  </th><td> ".$_POST["currencyEnt"]." </td>\n".

      "<th> GL_ACC    </th><td> ".$_POST["glAccEnt"]." </td>\n".

      "<th> GL_SUB_ACC</th><td> ".$_POST["glSubAccEnt"]." </td>\n".

      "</tr>\n".
      "</table><br/>\n";

echo  "<table border='1' class='dedeq'>\n".
      "<tr>\n".
      "<th> No   </th>\n".
      "<th> USER </th>\n".
      "</tr>\n";

for($iRow = 0; $iRow < $nDetail; $iRow++){

  echo  "<tr>\n".

        "<td> ".($iRow + 1)." </td>\n".

        "<td> ".$_POST["userEnt"][$iRow]." </td>\n".

        "</tr>\n";
}

echo  "</table><br/>\n";
?>